import request from '@/utils/request'

/**
 * 获取菜单列表
 */
export const menuList = () => {
  return request({
    method: 'GET',
    url: '/menus'
  })
}

/**
 * 菜单删除
 */
export const deleteMenu = id => {
  return request({
    method: 'DELETE',
    url: `/menus/${id}`
  })
}

/**
 * 菜单修改
 */
export const changeMenu = data => {
  return request({
    method: 'PUT',
    url: `/menus/${data.id}`,
    data
  })
}

/**
 * 菜单添加
 */
export const addMenu = data => {
  return request({
    method: 'POST',
    url: '/menus',
    data
  })
}
